package com.qq.nacos.controller;

import com.qq.nacos.config.NacosConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/qq")
public class GatewayController {

    private final static String SERVER_PORT = "9001";

    @Autowired
    private NacosConfig nacosConfig;

    @GetMapping("/get")
    public String getServerPort() {
        return "商品的库存-1：" + SERVER_PORT;
    }

    @GetMapping("test")
    public String test() {
        return "name:" + nacosConfig.getName() + ",age:" + nacosConfig.getAge() + ",sex:" + nacosConfig.getSex();
    }
}
